<div  id="wechatuser_container">
	<div class="row">
		<div class="col-xs-12">
		<div id="search_box" class="widget-box  ui-sortable-handle collapsed">
				<div class="widget-header">
				 	<div class="nav-search"  style="padding-top: 5px;  right: 50px">
						<span class="input-icon">
							<input type="text"  id="wechatUserQueryParam_name"  i18n="wechat.user.nickname"  placeholder ="姓名" class="nav-search-input"  >
							<i class="ace-icon fa fa-search nav-search-icon" onclick="$('#wechatUserSearchBtn',$('#wechatuser_container')).click()" ></i>
						</span>
					</div>
 
					<div class="widget-toolbar">
						<a href="#" data-action="collapse">
							<i class="1 ace-icon fa bigger-125 fa-chevron-up"></i>
						</a>
					</div>
				</div>
				
				<div class="widget-body" style="display: none;">
					<div class="widget-main">
					
						<div class="row">
						      
					           <div class="col-xs-12 col-sm-6 ">
							    <div id="userSearchDiv" class="input-group col-xs-12  col-sm-6  " style="padding-bottom: 2px">
							    	<input type="text"  id="wechatUserQueryParam_telNum"  i18n="wechat.user.telNum"  placeholder ="手机号码" class="nav-search-input"  >
									<span class="input-group-btn">
										<button id="wechatUserSearchBtn" type="button" class="btn btn-purple btn-sm">
											<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
											<span i18n="find"></span>
										</button>
									</span>
				              </div>
				              </div>
				         </div>     
			              
					</div>
				</div>
				
				 
 
			</div>
							    
			
			<table id="wechatuser_grid-table"></table>

			<div id="wechatuser_grid-pager"></div>

		</div>
		<!-- /.col -->
	</div>
	<!-- /.row -->
 
</div>



<script type="text/javascript">
var scripts = [ null, null ];
$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
	var $container = $('#wechatuser_container');
	var grid_selector  = "#wechatuser_grid-table";
	var pager_selector = "#wechatuser_grid-pager";
	var  wechatuserGrid = null;
	
	var lang = $.homeGlobal.LANG.replace('_',"-");
	var colNames;
	$.loy.i18n(['i18n/wechat/wechat_user'],$.homeGlobal.LANG,$container,{custCallback:function(){
		$('input, textarea',$container).placeholder();
		colNames =[
	               $.i18n.prop("wechat.user.nickname"),
	               $.i18n.prop("wechat.user.telNum"),
	               $.i18n.prop("wechat.user.sex"),
	               $.i18n.prop("wechat.user.country"),
	               $.i18n.prop("wechat.user.province"),
	               $.i18n.prop("wechat.user.city"),
	               $.i18n.prop("wechat.user.subscribetime"),
	               $.i18n.prop("wechat.user.certNum"),
	               $.i18n.prop("wechat.user.subscribe"),
	               $.i18n.prop("wechat.user.isBinding")
	               
	               ]
	     
		createWechatUserGrid();
	}});
	
	

	function  createWechatUserGrid(){
		
		wechatUserGrid =jQuery(grid_selector).loyGrid({
			url: 'wechat/user/page', 
			datatype: "json",
			mtype: 'GET',
			colNames:colNames,
			colModel: [
			{ name: 'nickname', index: 'nickname',width: 40, align: "left",editable: false},
			{ name: 'telNum', index: 'telNum', width: 100, align: "left",editable: false},
	   		{ name: 'sex', index: 'sex', width: 40, align: "left",editable: false }, 
	   		{ name: 'country', index: 'country', width: 60, align: "left",editable: false },
	   		{ name: 'province', index: 'province', width: 60, align: "left",editable: false },
	   		{ name: 'city', index: 'city', width: 60, align: "left",editable: false },
	   		{ name: 'subscribeTime', index: 'subscribeTime', width: 100, align: "left",editable: false},
	   		{ name: 'certNum', index: 'certNum', width: 100, align: "left",editable: false  },
	   		{ name: 'subscribe', index: 'subscribe', width: 40, align: "left",editable: false, formatter: "select", editoptions:{value:'true:是;false:否'} },
	   		{ name: 'isBinDing', index: 'isBinDing', width: 40, align: "left",editable: false, formatter: "select", editoptions:{value:'true:是;false:否'} },

	   		], 
	   		height: getGridDefaultHeight(),
			pager: pager_selector, 
			loadComplete:function(data){
				loadComplete(data);
		
			}
		}).loyGrid('navGrid','#wechatuser_grid-pager',{"baseUrl":"wechat/user/",view : true,
			add : false,
			edit : false,
			del : false,});
		wechatUserGrid.jqGrid('setFrozenColumns');
	}
	
	$('#wechatUserQueryParam_name',$container).bind('keypress',function(event){
        if(event.keyCode == "13"){
           $('#wechatUserSearchBtn',$container).click();
        }
    });
	
	
	$("#wechatUserSearchBtn",$container).click(function(){
	 
		var name = $("#wechatUserQueryParam_name",$container).val();
		var telNum = $("#wechatUserQueryParam_telNum",$container).val();
		var postData ={"name":name,"telNum":telNum,page:0};
		wechatUserGrid.loyGrid("setGridParam",{"postData":postData}).trigger("reloadGrid"); 
		
	});
 

});

</script>
